<template>
  <div>
    <p>{{ a }}</p>
    <button @click="setA">修改<p>{{ b }}</p></button>
    <ul>
      <li v-for="item in arr">{{item}}</li>
    </ul>
  </div>
</template>
  
<script>
import { ref } from 'vue'
export default {
  setup() {
    let a = ref(1);
    let b = ref(1);
    let arr = ref(['yiyi', 'coco']);
    let setA = ref(() => {
      b.value++;
    })
    return {
      a,
      b,
      setA,
      arr
    }
  }
}
</script>
  
<style lang="less" scoped></style>